import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("buy_order", { schema: "predict" })
export class BuyOrder {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "user_id",
    comment: "用户id",
    unsigned: true,
    default: () => "'0'",
  })
  userId: number;

  @Column("int", {
    name: "group_id",
    comment: "用户类型",
    unsigned: true,
    default: () => "'0'",
  })
  groupId: number;

  @Column("varchar", { name: "name", length: 20, default: () => "'名称'" })
  name: string;

  @Column("decimal", {
    name: "price",
    comment: "价格",
    precision: 6,
    scale: 2,
    default: () => "'0.00'",
  })
  price: string;

  @Column("int", {
    name: "expire",
    comment: "有效期",
    unsigned: true,
    default: () => "'0'",
  })
  expire: number;

  @Column("tinyint", {
    name: "expire_type",
    comment: "有效期类型",
    unsigned: true,
    default: () => "'1'",
  })
  expireType: number;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;
}
